<form name="editForm" class="form-horizontal" ng-init="dvm.init()" ng-submit="dvm.save(editForm.$valid)" novalidate>
  <div class="modal-header">
    <button type="button" class="close" ng-click="dvm.cancel()">&times;</button>
    <h4 class="modal-title" ng-if="dvm.action == 'new'">新建文件夹</h4>
    <h4 class="modal-title" ng-if="dvm.action == 'rename'">重命名文件夹</h4>
  </div>
  <div class="modal-body">
    <div class="form-group">
      <label class="col-sm-2 control-label">文件夹名：</label>
      <div class="col-sm-10">
        <input type="text" name="folder" class="form-control" ng-model="dvm.folder" required autofocus
            pattern="^[^:\\*\\?&quot;&lt;&gt;\\|/]{1,255}$"
            ng-class="{'invalid': editForm.$submitted && editForm.folder.$invalid}">
        <p class="text-danger" ng-show="editForm.$submitted && editForm.folder.$error.required">文件夹名不能为空</p>
        <p class="text-danger" ng-show="editForm.$submitted && editForm.folder.$error.pattern">文件夹名格式不正确</p>
      </div>
    </div>
  </div>
  <div class="modal-footer">
    <button ng-if="dvm.action == 'new'" type="submit" class="btn btn-primary"
        ng-disabled="editForm.$invalid || dvm.origin == dvm.folder">新建</button>
    <button ng-if="dvm.action == 'rename'" type="submit" class="btn btn-primary"
        ng-disabled="editForm.$invalid || dvm.origin == dvm.folder">重命名</button>
    <button type="button" class="btn btn-default" ng-click="dvm.cancel()">取消</button>
  </div>
</form>
